<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title></title>
		<#include "/admin/include/head.htm">
		<script type="text/javascript" src="${base}/resource/js/password.js" ></script>
		<script type="text/javascript">
			$(function() {
				var mainform = $("#mainform");
				//表单底部按钮
				LG.setFormDefaultBtn(f_cancel, function() {
					f_save(mainform, "b2c_member_list");
				});
				jQuery.validator.addMethod("passwordFM", function(value, element) {   
				    return this.optional(element) <#if member??>|| value==''</#if> || checkPassword(value).success;       
				 }, '密码长度为6-20个字符，由字母、数字、符号的两种以上组合');   
			});
		</script>
	</head>
	<#if !member??>
	<#assign isAdd = true />
	<#else>
	<#assign isEdit = true />
	</#if>
	<body style="overflow:hidden;padding:10px;">
		<form action="<#if isAdd??>${base}/admin/b2c/member/save.jhtml<#else>${base}/admin/b2c/member/update.jhtml</#if>" method="post" id="mainform" class="validate">
			<div id="tabcontainer" style="overflow:hidden;margin:3px;">
				<#if !isAdd??>
				<input type="hidden" name="id" value="${(member.id)!''}"/>
				</#if>
				<table class="table" style="width:100%;">
					<tr>
						<th>用户名：</th>
						<td> <#if member??>
							${member.username}
						<#else>
							<input type="text" class="formText {minlength:6,maxlength:20,required:true,remote: '${base}/admin/b2c/member/checkUsername.jhtml?oldValue=${(member.username)!}', messages: {remote: '登录帐号已存在!'}}" value="${(member.username)!''}" name="username">
						</#if> </td>
					</tr>
					<tr>
						<th>密码：</th>
						<td>
							<input type="password" id="password" class="formText {<#if !member??>required:true,</#if>passwordFM:true}" name="password">
							<#if isEdit??>(留空表示不修改密码)</#if> 
						</td>
					</tr>
					<tr>
						<th>确认密码：</th>
						<td>
							<input type="password" class="formText {<#if !member??>required:true,</#if>equalTo:'#password'}" >
						</td>
					</tr>
					<tr>
						<th>昵称：</th>
						<td>
						<input type="text" class="formText" value="${(member.name)!''}" name="name">
						</td>
					</tr>
					<tr>
						<th>性别：</th>
						<td> <@u.radio name="sex" list={'true': '男', 'false':'女'}
						value="${((member.sex)?string('true', 'false'))!'true'}"/> </td>
					</tr>
					<tr>
						<th>电子邮箱：</th>
						<td>
						<input type="text" class="formText {email:true,remote: '${base}/admin/b2c/member/checkEmail.jhtml?oldValue=${(member.email)!}', messages: {remote: '电子邮箱已被使用!'}}" value="${(member.email)!''}" name="email">
						</td>
					</tr>
					<tr>
						<th>手机号码：</th>
						<td>
						<input type="text" class="formText {required:true,mobile:true,remote: '${base}/admin/b2c/member/checkMobile.jhtml?oldValue=${(member.mobile)!}', messages: {remote: '手机号码已被使用!'}}" value="${(member.mobile)!''}" name="mobile">
						</td>
					</tr>
					<tr>
						<th>邮政编码：</th>
						<td>
						<input type="text" class="formText {postCode:true}" value="${(member.zipCode)!''}" name="zipCode">
						</td>
					</tr>
					<tr>
						<th>联系地址：</th>
						<td>
						<input type="text" class="formText {maxlength:255}" value="${(member.address)!''}" name="address">
						</td>
					</tr>
				</table>
			</div>
		</form>
	</body>
</html>